package com.example.recyclerview.utli;

import android.text.InputFilter;
import android.text.Spanned;

public class SpaceFilter implements InputFilter {

    @Override
    public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
        StringBuilder stringBuilder = new StringBuilder();
        for (int i = 0; i < source.length(); i++) {
            char c = source.charAt(i);
            String str = String.valueOf(c);
            if (!str.equals(" ")) {
                stringBuilder.append(str);
            }
        }
        return stringBuilder;
    }
}